<template>
  <div class="hot-recommend">
    <div class="recommend-banner">
      <ImgAspect
        class="img"
        :lazy="true"
        :radius="12"
        :width="319"
        :height="276"
        :src="detail.img"
      />
      <p>{{ detail.bannerDesc ? detail.bannerDesc : '' }}</p>
    </div>
    <div class="recommend-content">
      <div class="leftimg">
        <ImgAspect
          :lazy="true"
          :radius="3"
          :width="76"
          :height="102"
          :src="detail.img"
        />
      </div>
      <div class="desc-right">
        <h3>{{ detail.title ? detail.title :'' }}</h3>
        <p>{{ detail.desc ? detail.desc : '' }}</p>
        <span>阅读</span>
      </div>
    </div>
  </div>
</template>

<script>
import defaultImage from '../static/images/mascot-dance.gif'
import ImgAspect from '~/components/ImgAspect'
export default {
  components: {
    ImgAspect
  },
  props: {
    // eslint-disable-next-line vue/require-prop-types
    detail: {
      required: true,
      default: () => {
        return {
          img: '',
          title: '',
          desc: '',
          section: '',
          bannerHref: '',
          bannerDesc: ''
        }
      }
    }
  },
  data () {
    return {
      defaultImage
    }
  }
}
</script>
<style lang="scss" scoped>
    .hot-recommend {
        box-sizing: border-box;
        padding: 20px;
        border-radius: 12px;
        // margin-bottom: 20px;
        .recommend-banner {
            position: relative;
            .img {
                width: 100%;
                border-radius: 12px;
                display: block;
            }
            >p {
                position: absolute;
                left: 10px;
                bottom: 20px;
                color: #eee;
                font-size: 16px;
                z-index: 1;
                font-weight: bold;
            }
        }
        .recommend-content {
            display: flex;
            box-sizing: border-box;
            padding: 20px;
            padding-bottom: 12px;
            background-color: $content-bg;
            .leftimg {
              width: 78px;
            }
            .desc-right {
                flex: 1;
                box-sizing: border-box;
                padding: 10px;
                padding-top: 0px;
                margin-left: 10px;
                h3 {
                    color: #fff;
                    font-size: 17px;
                }
                p {
                    font-size: 14px;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    display: -webkit-box;
                    -webkit-line-clamp: 2;
                    color: #c6c2c2;
                    margin: 4px 0px;
                    -webkit-box-orient: vertical;
                }
                span {
                    padding: 3px 12px;
                    display: inline-block;
                    border-radius: 4px;
                    color: #c6c2c2;
                    background: $content-bg;
                    border: 1px solid #8c8a8a;
                }
            }
        }
    }
</style>
